﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Xml;

namespace Messaging
{
    /// <summary>
    /// Message块，在web.config中提供Message块定义
    /// </summary>
    internal class MessageSection : ConfigurationSection
    {
        /// <summary>
        /// 账号
        /// </summary>
        [ConfigurationProperty("UserName", DefaultValue = "bfyxzls")]
        public string UserName
        {
            get { return (string)this["UserName"]; }
            set { this["UserName"] = value; }
        }
        /// <summary>
        /// 密码
        /// </summary>
        [ConfigurationProperty("Password", DefaultValue = "gemini123")]
        public string Password
        {
            get { return (string)this["Password"]; }
            set { this["Password"] = value; }
        }
        /// <summary>
        /// 邮件服务器地址
        /// </summary>
        [ConfigurationProperty("Host", DefaultValue = "smtp.sina.com")]
        public string Host
        {
            get { return (string)this["Host"]; }
            set { this["Host"] = value; }
        }
        /// <summary>
        /// 端口号
        /// </summary>
        [ConfigurationProperty("Port", DefaultValue = "25")]
        public int Port
        {
            get { return (int)this["Port"]; }
            set { this["Port"] = value; }
        }
        /// <summary>
        /// 发件人的email地址
        /// </summary>
        [ConfigurationProperty("Address", DefaultValue = "bfyxzls@sina.com")]
        public string Address
        {
            get { return (string)this["Address"]; }
            set { this["Address"] = value; }
        }
        /// <summary>
        /// 发送之后，在收件人端显示的名称
        /// </summary>
        [ConfigurationProperty("DisplayName", DefaultValue = "占占")]
        public string DisplayName
        {
            get { return (string)this["DisplayName"]; }
            set { this["DisplayName"] = value; }
        }

    }
}
